package main;

import java.util.ArrayList;

import core.boundary.UserInterfaceTUI;
import core.controller.CommandController;
import core.controller.cmds.*;
import core.dal.AdminFunctionality;
import core.dal.OperatorFunctionality;
import core.dal.WeightFunctionality;
import core.dto.Database;
import core.dto.OperatorDTO;
import core.dto.AdminDTO;
import core.dto.VirtualWeight;
import exceptions.UserNotFoundException;
import utilities.PasswordGenerator;

public class Main {

	public static void main(String[] args) {
			
		//This is a way to make the CMDs a part of Command Controller, but they've been split up for
		//increased overview
		
		OperatorDTO user1 = new OperatorDTO();
		OperatorDTO user2 = new OperatorDTO();
		AdminDTO user3 = new AdminDTO();
		
		user1.setCpr("280693-1234");
		user1.setOprId(12);
		user1.setOprNavn("Peter Lars");
		user1.setPassword("1234");
		
		user2.setCpr("111111-4442");
		user2.setOprId(13);
		user2.setOprNavn("Linda Sørensen");
		user2.setPassword("4321");
		
		user3.setCpr("123456-9876");
		user3.setOprId(10);
		user3.setOprNavn("Kurt Svendsen");
		user3.setPassword("02324it!");
		
		Database db = new Database();
		VirtualWeight vW = new VirtualWeight();
		
		db.add(user1);
		db.add(user2);
		db.add(user3);
		
		AdminFunctionality aF = new AdminFunctionality(db);
		OperatorFunctionality oF = new OperatorFunctionality(db);
		WeightFunctionality wF = new WeightFunctionality(vW);
		
		CommandController cc = new CommandController();
		cc.addCmd(new BackCMD(cc));
		cc.addCmd(new CalculateNettoCMD(cc, wF));
		cc.addCmd(new ChangePasswordCMD(cc, oF));
		cc.addCmd(new LoginCMD(cc, oF));
		cc.addCmd(new LogoutCMD(cc, oF));
		cc.addCmd(new EnterTestApplicationCMD(cc, wF));
		cc.addCmd(new CreateUserCMD(cc, aF));
		cc.addCmd(new DeleteUserCMD(cc, aF));
		cc.addCmd(new ShowUserCMD(cc, aF));
		cc.addCmd(new ShowAllUsersCMD(cc, aF));
		cc.addCmd(new UpdateUserCMD(cc, aF));
		
		
		cc.start();
	}

}
